package org.example.controller;

import org.example.model.UrlRole;
import org.example.repositories.TestRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: LiFuqiang
 * @Date: 2020/9/29 15:12
 * @Version 1.0
 * @description
 */
@RestController
public class AuthController {

    @Autowired
    private TestRepository testRepository;

    @GetMapping("/executeCmd/hadoop/start")
    public String verifyCode(HttpServletRequest request, HttpServletResponse resp) throws IOException {
        return "OK";
    }

    @GetMapping("/db")
    public String testDB(HttpServletRequest request, HttpServletResponse resp) throws IOException {
        List<UrlRole> lists = testRepository.findById(0);
        return "db OK";
    }
}
